package cn.wolfcode.luowowo.article.service.impl;

import cn.wolfcode.luowowo.article.domain.Region;
import cn.wolfcode.luowowo.article.mapper.RegionMapper;
import cn.wolfcode.luowowo.article.query.RegionQuery;
import cn.wolfcode.luowowo.article.service.IRegionService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * @author 猫教授
 * @date 2019/8/9 15:39
 */
@Service
public class RegionServiceImpl implements IRegionService {
    @Autowired
    private RegionMapper regionMapper;
    @Override
    public void deleteByPrimaryKey(Long id) {

    }

    @Override
    public void insert(Region record) {

    }

    @Override
    public Region selectByPrimaryKey(Long id) {
        return regionMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Region> selectAll() {
        return null;
    }

    @Override
    public void updateByPrimaryKey(Region record) {

    }

    @Override
    public PageInfo<Region> listAll(RegionQuery qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize(),qo.getOrderBy());
        List<Region> list=regionMapper.listAll(qo);
        return new PageInfo<Region>(list);
    }

    @Override
    public List<Region> selectHotRegions(RegionQuery regionQuery) {




        return regionMapper.listAll(regionQuery);
    }

    @Override
    public List<Region> selectRegions() {
        return regionMapper.selectRegion();
    }

}
